package org.fisharium.sharkarium.topshark;

import java.net.URI;
import java.net.URLEncoder;

/**
 * Java representation of topshark.js logic.
 *
 * @author Andrey Zhemoytuk
 */
public class TopsharkEngine {

    public void searchPlayer(String playerName) {
        // TODO: Refactor it!!!
        try {
            // var b = encodeURIComponent(encodeURIComponent(encodeURIComponent(a.value.replace(/</g, "%3c").replace(/>/g, "%3e"))));
            String encoded = playerName.trim().replace("<", "%3c").replace(">", "%3e");
            URLEncoder.encode(encoded, "UTF-8");

            //createRequest(GetSearchUrl("playername", b, document.getElementById(PokerClientsDropDownList).value), OnSearchComplete, "OnSearchComplete(null)")
            
        } catch (Exception e) {
            // Tralala
            e.printStackTrace();
        }
    }

}
